<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 文档内容管理 控制器
 */
class Article extends Admin_Controller {

    public function __construct() {
        parent::__construct();
        log_message('debug', 'Article Admin Controller Class Initialized');
    }

    public function index() {
        $this->load->service('doc/category_service');

        $data = array();
        $data['title'] = '文档管理';
        $data['cat_dropdown'] = $this->category_service->get_dropdown();
        $data['cat_tree'] = $this->category_service->get_tree();
        $this->load->view('article/article_index', $data);
    }

    /**
     * 列表页面
     */
    public function lists() {
        $category_id = $this->input->get('category_id', true);
        $this->load->service('doc/category_service');

        $data = array();
        $data['title'] = '文档管理';
        $data['category_id'] = $category_id;
        $data['cat_dropdown'] = $this->category_service->get_dropdown($category_id);
        $this->load->view('article/article_lists', $data);
    }

    /**
     * 添加页面
     */
    public function add() {
        $special = $this->input->get('special', true);

        $this->load->library('form_validation');
        $this->form_validation->set_rules('title', '文档标题', 'required');
        if ($this->form_validation->run() == true) {
            $post = $this->input->post(null, true);


        } else {
            if ($error = $this->form_validation->get_error()) $this->show_error($error);

            $this->load->service('doc/post_service');

            $data = array();
            $data['title'] = '文档管理';
            $data['create_html'] = $this->post_service->create_html();
            $this->load->view('article/article_add', $data);
        }
    }

    /**
     * 编辑页面
     */
    public function edit() {

    }

    /**
     * 删除处理
     */
    public function dodel() {

    }
}

/* End of file admin/article.php */
/* Location: ./application/controllers/admin/article.php */
